package com.gitee.wsl.transform.encode.pinyin.interval

object IntervalableComparatorBySize : Comparator<Intervalable> {
    override fun compare(intervalable: Intervalable, intervalable2: Intervalable): Int {
        var comparison: Int = intervalable2.size - intervalable.size

        if (comparison == 0) {
            comparison = intervalable.start - intervalable2.start
        }

        return comparison
    }
}
